package zigzag.designpattern.command;

import java.util.*;

public class Invoker {

	private Map cmds;
	public Invoker(){
		cmds = new HashMap();
	}
	public void addCommand(String cmdName, ICommand command){
		cmds.put(cmdName, command);
	}
	public void request(String cmdName){
		ICommand command = (ICommand)cmds.get(cmdName);
		command.execute();
	}
	
}
